<template>
  <el-menu mode="horizontal" class="header-menu" :default-active="activeIndex" router>
    <el-menu-item index="/homepage">首页</el-menu-item>
    <el-menu-item index="/funds">产品</el-menu-item>
    <el-menu-item index="/backtest">回测</el-menu-item>
  </el-menu>
</template>

<script setup lang="ts">
import { computed } from 'vue'
import { useRoute } from 'vue-router'

const route = useRoute()
const activeIndex = computed<string>(() => route.path)
</script>

<style lang="scss" scoped>
.header-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 0;
  padding: 0 !important;
  height: 3.75rem;
  z-index: 1000;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
}

:deep(.el-menu-item) {
  height: 60px;
  line-height: 60px;
  margin: 0 40px;
  border: none;
  transition: all 0.3s ease;
  width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent !important;
}

:deep(.el-menu-item:hover) {
  background: transparent !important;
}

:deep(.el-menu-item.is-active) {
  background: transparent !important;
  font-weight: bold;
}
</style>
